import type { CSSProperties } from "vue";
import type { PipePathStyle } from "../AttrPanel/types";
import type { PipePathSpeed, PipePathType } from "/@/components/types";

export type Condition = CommonCondition &
  Partial<LabelValueSettableProps> &
  Partial<PipePathSettableProps> &
  Partial<CommonSettableProps>;

/**
 * 公共的条件属性
 */
export interface CommonCondition {
  id: string;
  dataKey: string;
  min: number | null;
  max: number | null;
}

export interface LabelValueSettableProps {
  rotate: number;
  labelCssProps: CSSProperties;
  valueCssProps: CSSProperties;
  unitCssProps: CSSProperties;
}

export interface PipePathSettableProps {
  isFloating: boolean;
  isReverse: boolean;
  speed: PipePathSpeed;
  pipePathStyle: PipePathStyle;
}

export interface CommonSettableProps {
  animateClass: AnimateClass | "";
}

export enum AnimateClass {
  blink = "vc-animate-blink",
}

export type PipePathOriginalProps = PipePathSettableProps & { type: PipePathType };
export type LabelValueOriginalProps = LabelValueSettableProps & CommonSettableProps;

export interface SetPropsExpose {
  clear: () => void;
  setCondition: (condition: Condition) => void;
  getSetResult: () => false | Partial<LabelValueSettableProps> | Partial<PipePathSettableProps>;
}
